#include <iostream>
using namespace std;
class Solution
{
public:
    bool repeatedSubstringPattern(string s)
    {
        // 移动匹配方法
        string ss(s + s);
        ss.erase(ss.begin());
        ss.erase(ss.end() - 1);
        return ss.find(s) != string::npos;
    }
};

int main()
{
    Solution sol;
    cout << sol.repeatedSubstringPattern("ababababc") << endl;
    cout << "string::npos = " << string::npos << endl;

    return 0;
}